<?php
function smarty_modifier_price($price) {
    $price = str_replace('.', ',', $price);
    $pos = strpos($price, ',');
    if ($pos === false) {
        return "$price,00";
    } else {
        $length = strlen(substr($price, $pos) + 1);
        return $length == 0 ? "{$price}00" :
                ($length == 1 ? "{$price}0" : $price);
    }
}
?>
